package com.park.web.controller.admin;

import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SchedulerFactory;
import org.quartz.impl.StdSchedulerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.park.web.controller.BaseController;

@Controller
@RequestMapping
public class QuartzController extends BaseController{

	public void add(){
		try {
			// 通过SchedulerFactory获取一个调度器实例  
			SchedulerFactory sf = new StdSchedulerFactory();   
			Scheduler sched = sf.getScheduler();
			// 启动调度器  
			sched.start();
//			JobDetail job = JobBuilder(QuartzJob.class).withIdentity("HelloJob", "group1").build(); 
//            Trigger trigger = newTrigger().withIdentity("HelloJob", "group1").startNow().withSchedule(simpleSchedule()
//                      .withIntervalInSeconds(10)
//                      .repeatForever()).build();  
//            sched.scheduleJob(job, trigger);  
		} catch (SchedulerException e) {
			e.printStackTrace();
		} finally {
		} 
	}
}
